/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package merlion.scm.icm.session;

import java.util.Collection;
import java.util.List;
import javax.ejb.Local;
import merlion.crm.sopm.entity.ItemLine;
import merlion.frm.bpm.entity.SupplierInvoice;
import merlion.mrp.pmm.entity.FinishedGood;
import merlion.mrp.ppm.entity.Product;
import merlion.scm.icm.entity.ProductInventoryRecord;
import merlion.scm.rmpm.entity.GoodsReceipt;
import merlion.scm.rmpm.entity.RawMaterial;
import merlion.scm.rmpm.entity.RawMaterialInventoryBatch;
import merlion.scm.rmpm.entity.RawMaterialInventoryRecord;
import merlion.scm.rmpm.entity.RawMaterialItemLine;
import merlion.scm.rmpm.entity.RawMaterialSalesOrder;

/**
 *
 * @author Kenn
 */
@Local
public interface InventoryControlSessionBeanLocal {
    
    public Collection<ProductInventoryRecord> getAllProductInventoryRecord();
    public ProductInventoryRecord getProductInventoryRecordById(Long id);
    public ProductInventoryRecord getProductInventoryRecordByProduct(Product p);
   // public Collection<FinishedGood> getFinishedGoodInventoryBatchByProductInventoryRecord(ProductInventoryRecord pir);
  //  public FinishedGood getFinishedGoodInventoryBatchById(Long id);
    public ProductInventoryRecord saveProductInventoryRecord(ProductInventoryRecord pir);
    public Collection<RawMaterialInventoryBatch> getRawMaterialInventoryBatchByRawMaterialInventoryRecord(RawMaterialInventoryRecord rm);
    public Collection<RawMaterialInventoryRecord> getAllRawMaterialInventoryRecord();
    public RawMaterialInventoryRecord getRawMaterialInventoryRecordById(Long id);
    public RawMaterialInventoryRecord getRawMaterialInventoryRecordByRawMaterial(RawMaterial rm);
    public RawMaterialInventoryBatch getRawMaterialInventoryBatchById(Long id);
    public RawMaterialInventoryRecord saveRawMaterialInventoryRecord(RawMaterialInventoryRecord rmir);
    //For MRP to call
    public Boolean reserveInventory(ItemLine deliveryOrderIl, Long qty);
    public boolean unreserveInventory(Long deliveryOrderId);
    public Long getRealInventory(String productType); 
    public Long getAvailableInventory(String productType);
    public FinishedGood arrangeBatchLocation(FinishedGood batch);
    public FinishedGood addBatchToInventoryRecord(FinishedGood fg, Product p);
    public Collection<RawMaterialSalesOrder> getAllSalesOrderWOGoodsReceipt();
    public Boolean createGoodsReceipt(GoodsReceipt gr);
    public GoodsReceipt getGoodsReceiptById(Long id);
    public String generateRawMaterialBatchNumber(RawMaterial r);
    public Boolean consumeRawMaterialInventory (List<Double> consumed);
    public Boolean matchGoodsReceiptItems(GoodsReceipt gr);
    public GoodsReceipt updateGoodsReceipt(GoodsReceipt gr);
    public String generateGoodsReceiptId();
}
